﻿@using FCTC_Web.Utilities
@using DAL
@using FCTC_Web.Models
@model FCTC_Web.Models.Team
@{
    // ViewBag.Title = "天诚二手车";
}
@Combres.HtmlExtensions.CombresLink("backjs")
@*<script type="text/javascript">
    $(document).ready(function () {
        $(":button").click(function () {
            $this = $(this);
            //            var teamid = $('#ID').val();
            var value = $this.val();
            if (value == "添加队员") {
                $.ajax({
                    url: "/Team/MemberCreate",
                    datatype: "html",
                    type: 'GET',
                    traditional: true,
                    success: function (result) {
                        $('#memberlist').html(result);
                    }
                });
            }
        });
    });
</script>*@
@Html.ValidationSummary(true)
<fieldset>
    <legend>参赛队伍</legend>
    <div class="editor-label">
        @Html.LabelFor(model => model.FullName)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.FullName)
        @Html.ValidationMessageFor(model => model.FullName)
    </div>
    <div class="editor-label">
        @Html.LabelFor(model => model.TeamContactor)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.TeamContactor)
        @Html.ValidationMessageFor(model => model.TeamContactor)
    </div>
    <div class="editor-label">
        @Html.LabelFor(model => model.SessionStatus)
    </div>
    <div class="editor-field">
        @Html.DropDownListFor(model => model.SessionStatus, new SelectList(new List<string>{  
                       "参赛中", 
                       "被淘汰", 
                       "放弃比赛",
                       "其他"}), "--请选择--")
        @Html.ValidationMessageFor(model => model.SessionStatus)
    </div>
    <div class="editor-label">
        @Html.LabelFor(model => model.ContactNumber)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.ContactNumber)
        @Html.ValidationMessageFor(model => model.ContactNumber)
    </div>
    <div class="editor-label">
        @Html.LabelFor(model => model.Motto)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.Motto)
        @Html.ValidationMessageFor(model => model.Motto)
    </div>
</fieldset>
<fieldset>
    <legend>参赛队员</legend>
    @if (Model != null)
    {
        @Html.Hidden("ID", Model.ID)
    }
    <div id="memberlist">
        @Html.Partial(@"~\views\team\partial\memberlist.cshtml", Model == null ? null : Model.Members)
    </div>
</fieldset>
@Html.Partial(@"~\views\shared\controls\otherschange.cshtml", Model)
<p>
    <input type="submit" value="保存" />
</p>
@Html.ActionLink("回到列表", "Index")
